package com.lichuang.fruitvarietysm.goods.controller;


import com.lichuang.fruitvarietysm.goods.entity.GoodsDetailImg;
import com.lichuang.fruitvarietysm.goods.service.impl.GoodsDetailImgServiceImpl;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author shuaihang
 * @since 2019-06-05
 */
@RestController
@RequestMapping("//goods-detailImg")
public class GoodsDetailImgController {

    @Autowired
    GoodsDetailImgServiceImpl goodsDetailImgService;

    //根据商品id，查找对应的商品中间图片
    @RequestMapping("/goodsMiddleImg")
    public Object goodsMiddleImg(@RequestParam("goods_id")Integer goods_id){
        List<GoodsDetailImg> goodsDetailImg=goodsDetailImgService.sMiddle_img(goods_id);
        return goodsDetailImg;
    }
    //根据商品id，查找对应的商品详情图片即大图片
    @RequestMapping("/goodsLarge_img")
    public Object goodsLarge_img(@RequestParam("goods_id")Integer goods_id){
        List<GoodsDetailImg> goodsDetailImg=goodsDetailImgService.sLarge_img(goods_id);
        return goodsDetailImg;
    }

}
